home *** CD-ROM | disk | FTP | other *** search
- package com.sun.java.swing.plaf.metal;
-
- import com.sun.java.swing.Icon;
- import com.sun.java.swing.JComponent;
- import com.sun.java.swing.UIManager;
- import com.sun.java.swing.plaf.ComponentUI;
- import com.sun.java.swing.plaf.ToggleButtonUI;
- import java.awt.Dimension;
- import java.awt.Graphics;
- import java.awt.Rectangle;
-
- public class MetalCheckBoxUI extends MetalRadioButtonUI {
- private static ToggleButtonUI checkboxUI;
-
- public Icon createIcon() {
- return UIManager.getIcon("CheckBox.icon");
- }
-
- public static ComponentUI createUI(JComponent b) {
- if (checkboxUI == null) {
- checkboxUI = new MetalCheckBoxUI();
- }
-
- return checkboxUI;
- }
-
- protected void paintFocus(Graphics g, Rectangle t, Dimension d) {
- g.setColor(UIManager.getColor("CheckBox.focus"));
- g.drawRect(t.x, t.y - 1, t.width + 1, t.height + 1);
- }
- }
-